package com.zsr.example.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
//@PropertySource(value = {"classpath:dev-key.yml"},factory = YamlAndPropertySourceFactory.class)
public class WXPayConfigProperties implements InitializingBean {

    @Value("${weixin.pay.appid}")
    private String appid;

    @Value("${weixin.pay.partner}")
    private String partner;

    @Value("${weixin.pay.partnerkey}")
    private String partnerkey;

    @Value("${weixin.pay.notifyurl}")
    private String notifyurl;

    public static String PAY_APPID;
    public static String PAY_PARTNER;
    public static String PAY_PARTNERKEY;
    public static String PAY_NOTIFYURL;

    @Override
    public void afterPropertiesSet() throws Exception {
        PAY_APPID=this.appid;
        PAY_PARTNER=this.partner;
        PAY_PARTNERKEY=this.partnerkey;
        PAY_NOTIFYURL=this.notifyurl;
    }
}
